import mockRequest from "@/utils/mockRequest";
// 个人信息
interface res {
   code: number;
   data: UserInfoModel;
   message: string;
}
interface response {
   code: number;
   data: UserInfo;
   message: string;
}
// 会员信息
interface Double {
   code: number;
   data: MemberModel;
   message: string;
}

export interface UserInfo {
   avatar: string;
   level: number;
   account: string;
}
export interface UserInfoModel {
   data: {
      account: string;
      avatar: string;
      level: number;
      statisticsBackup: {
         followCount: number;
         fansCount: number;
      };
      avocation: [];
      channel: {
         groupType: string;
      };
      moreBackup: {
         skillLevel: number;
         birthDate: string;
         sex: string;
         skillLevelName: string;
         city: string;
      };
   };
}
export interface MemberModel {
   data: {
      channel: string;
      createTime: number;
      data: {
         total_price: number;
         time_limit: boolean;
         vip_grade: number;
         end_time: string;
         title: string;
         duration: number;
         apple_priceId: string;
         cover: string;
         start_time: string;
         unit: string;
         renew_time: string;
         price: number;
         isYouthOnly: boolean;
         recom: false;
      };
      groupName: string;
      groupType: string;
      id: string;
      sortNum: number;
      status: string;
      subGroupName: string;
      subGroupType: string;
      updateTime: number;
      version: string;
   };
}
export default {
   // 个人信息
   getInfo(){
      return mockRequest.get<any, response>(`/getInfo`);
   },
   // 会员信息
   getMember() {
      return mockRequest.get<any, Double>(`/getMember`);
   },
   // 个人资料信息
   getInformation() {
      return mockRequest.get(`/getInformation`);
   },
   // 保存
   getSave(info: any) {
      return mockRequest.get(`/save`, info);
   },
};
